package com.example.handlercontext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author by linenxi
 * @Classname MyController
 * @Description
 * @Date 2019/5/5
 */
@RestController
public class MyController {

    @Autowired
    private OrderHandlerContext orderHandlerContext;

    @GetMapping("test/{type}")
    public void test(@PathVariable String type) {
        BasicOrderHandler instance = orderHandlerContext.getInstance(type);
        instance.say();
    }
}
